home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 11 / CU Amiga Magazine's Super CD-ROM 11 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-06].iso / s / groupcopytopages.pprx < prev    next >
Text File  |  1993-02-15  |  2KB  |  89 lines

  1. /*
  2. @BGroupCopyToPages  @P@ICopyright Gold Disk Inc. Jan, 1993
  3.  
  4. Copy the current group to a specified range of pages.
  5. */
  6. parse arg startpage, endpage
  7. address command
  8. call SafeEndEdit.rexx()
  9. call ppm_AutoUpdate(0)
  10. pageoptions = "ODDEVENALL "
  11. last = ppm_DocLastPage()
  12. first = ppm_DocFirstPage()
  13.  
  14. box = ppm_GroupFirstBox()
  15. if box = 0 then exit_msg("Select a group of boxes first")
  16.  
  17. if startpage = '' then
  18. do
  19.     form = "Start Page:"first'0a'x"End Page:"last'0a'x"ODD/EVEN/ALL:"all
  20.     form = upper(ppm_GetForm("Enter options", 8, form))
  21.         if form = '' then exit_msg()
  22.  
  23.     parse var form startpage '0a'x endpage '0a'x pageopts
  24.  
  25.     if endpage = '' then endpage = startpage
  26.     if pageopts = '' then pageopts = 'ALL'
  27.  
  28. end
  29.  
  30. if ~(datatype(startpage,n) & datatype(endpage,n)) then
  31.     exit_msg("Invalid input")
  32.  
  33. if verify(pageopts, pageoptions) ~= 0 then exit_msg("Invalid Input")
  34. opos = pos(pageopts, pageoptions)
  35.  
  36. if opos = 4 then
  37. do
  38.     increment = 2
  39.     if (startpage // 2) then startpage = startpage + 1
  40. end
  41. else if opos = 1 then
  42. do
  43.     increment = 2
  44.  
  45.     if ~(startpage // 2) then startpage = startpage + 1
  46.  
  47. end
  48. else increment = 1
  49.  
  50. boxnum = 0
  51. do while box ~= 0
  52.  
  53.     boxnum = boxnum + 1
  54.     boxes.boxnum = box
  55.     box = ppm_GroupNextBox(box)
  56.  
  57. end
  58.  
  59. do page = startpage to endpage by increment
  60.  
  61.     do i = 1 to boxnum
  62.  
  63.            newbox   = ppm_CloneBox(boxes.i, 0, 0)
  64.            call ppm_BoxChangePage(newbox, page)
  65.  
  66.            if ppm_TextOverFlow(boxes.i) then
  67.            do
  68.                text = ppm_GetBoxText(boxes.i, 1)
  69.                call ppm_DeleteContents(newbox)
  70.                call ppm_TextIntoBox(newbox, text)
  71.            end
  72.  
  73.     end
  74.  
  75. end
  76.  
  77. exit_msg("Done")
  78.  
  79. exit_msg: procedure
  80. do
  81.     parse arg message
  82.  
  83.         if message ~= '' then
  84.    call ppm_Inform(1,message,)
  85.  
  86.     call ppm_AutoUpdate(1)
  87.     exit
  88. end
  89.